package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/schema"
	"entgo.io/ent/schema/field"
	"private-domain-overseas-service/pkg/status/bizadmin"
	"time"
)

// AdminRole holds the schema definition for the MallFans entity.
type AdminRole struct {
	ent.Schema
}

// Fields of the AdminRole.
func (AdminRole) Fields() []ent.Field {
	return []ent.Field{
		field.String("admin_role_name").NotEmpty().Comment("角色名"),
		field.Int64("admin_role_type").Default(bizadmin.TypeNormal).Comment("角色类型，1、普通用户，2、超级管理员，3、其他"),
		field.String("admin_role_router_ids").Optional().Comment("路由id"),
		field.String("admin_role_desc").Optional().Comment("角色描述"),
		field.Int64("is_delete").Default(bizadmin.NotDelete).Comment("是否删除,1、未删除,2、表示删除"),
		field.Time("create_at").Immutable().Default(time.Now).Comment("创建时间"),
		field.Time("update_at").Default(time.Now).Comment("更新时间"),
		field.Time("delete_at").Optional().Comment("删除时间"),
	}
}
func (AdminRole) Annotations() []schema.Annotation {
	return []schema.Annotation{
		entsql.WithComments(true),
		schema.Comment("后台角色表"),
	}
}
